package com.rainbow.autocode.entity;

import java.util.Objects;
import java.util.Set;

/**
 *列的枚举类型，格式必须为 箱号状态:0:拦截;1:可使用
 * @author 付为地
 */
public class ColumnEnum {

    //枚举名称
    private String name;

    //枚举备注
    private String remark;

    //枚举数据
    private Set<Item> item;

    public static class Item{
        //枚举对应名称
        private String name;
        //枚举code
        private String code;
        //枚举value
        private String value;

        public Item(String name, String code, String value) {
            this.name = name;
            this.code = code;
            this.value = value;
        }

        public String getName() {
            return name;
        }
        public void setName(String name) {
            this.name = name;
        }
        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }
        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) {return true;}
            if (o == null || getClass() != o.getClass()) {return false;}
            Item item = (Item) o;
            return Objects.equals(name, item.name) &&
                    Objects.equals(code, item.code) &&
                    Objects.equals(value, item.value);
        }

        @Override
        public int hashCode() {
            return Objects.hash(name, code, value);
        }
    }

    public ColumnEnum() {
    }

    public ColumnEnum(String name, String remark, Set<Item> item) {
        this.name = name;
        this.remark = remark;
        this.item = item;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Set<Item> getItem() {
        return item;
    }

    public void setItem(Set<Item> item) {
        this.item = item;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}
